package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DownMapper;
import com.ruoyi.system.domain.Down;
import com.ruoyi.system.service.IDownService;

/**
 * 资料下载Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-03
 */
@Service
public class DownServiceImpl implements IDownService 
{
    @Autowired
    private DownMapper downMapper;

    /**
     * 查询资料下载
     * 
     * @param fileId 资料下载主键
     * @return 资料下载
     */
    @Override
    public Down selectDownByFileId(Long fileId)
    {
        return downMapper.selectDownByFileId(fileId);
    }

    /**
     * 查询资料下载列表
     * 
     * @param down 资料下载
     * @return 资料下载
     */
    @Override
    public List<Down> selectDownList(Down down)
    {
        return downMapper.selectDownList(down);
    }

    /**
     * 新增资料下载
     * 
     * @param down 资料下载
     * @return 结果
     */
    @Override
    public int insertDown(Down down)
    {
        return downMapper.insertDown(down);
    }

    /**
     * 修改资料下载
     * 
     * @param down 资料下载
     * @return 结果
     */
    @Override
    public int updateDown(Down down)
    {
        return downMapper.updateDown(down);
    }

    /**
     * 批量删除资料下载
     * 
     * @param fileIds 需要删除的资料下载主键
     * @return 结果
     */
    @Override
    public int deleteDownByFileIds(Long[] fileIds)
    {
        return downMapper.deleteDownByFileIds(fileIds);
    }

    /**
     * 删除资料下载信息
     * 
     * @param fileId 资料下载主键
     * @return 结果
     */
    @Override
    public int deleteDownByFileId(Long fileId)
    {
        return downMapper.deleteDownByFileId(fileId);
    }
}
